#include <memory>
#include <iostream>

class Resource {
public:
    void use() { std::cout << "Using Resource\n"; }
};

int main() {
    std::unique_ptr<Resource> uniqRes(new Resource());
    std::shared_ptr<Resource> sharedRes(std::move(uniqRes));

    if (!uniqRes) {
        std::cout << "uniqRes is now empty, ownership transferred to sharedRes\n";
    }

    sharedRes->use(); // 使用资源
    return 0;
}